package jh.com.jhappbf.model;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

public class PlanModel implements Parcelable {

    private String planId;//主合同号
    private String plateNumer;//车号
    private String sender;//
    private String receiver;
    private String cargoname;
    private String spec;
    private String price;
    private String type;
    private String unit;//单位（发货或收货）
    private double amount;
    private String money;


    public PlanModel() {
    };

    private PlanModel(Parcel source) {
        planId = source.readString();
        sender = source.readString();
        receiver = source.readString();
        cargoname = source.readString();
        spec = source.readString();
        price = source.readString();
        type = source.readString();
        unit = source.readString();
        plateNumer = source.readString();
        amount = source.readDouble();
        money = source.readString();
    }

    public String getPlanId() {
        return planId;
    }

    public void setPlanId(String planId) {
        this.planId = planId;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getCargoname() {
        return cargoname;
    }

    public void setCargoname(String cargoname) {
        this.cargoname = cargoname;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public String getPlateNumber() {
        return plateNumer;
    }

    public void setPlateNumber(String plateNumer) {
        this.plateNumer = plateNumer;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        if (money.equals("null") || TextUtils.isEmpty(money)) {
            money = "";
        }
        this.money = money;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(planId);
        dest.writeString(sender);
        dest.writeString(receiver);
        dest.writeString(cargoname);
        dest.writeString(spec);
        dest.writeString(price);
        dest.writeString(type);
        dest.writeString(unit);
        dest.writeString(plateNumer);
        dest.writeDouble(amount);
        dest.writeString(money);

    }

    public final static Creator<PlanModel> CREATOR = new Creator<PlanModel>() {
        @Override
        public PlanModel createFromParcel(Parcel source) {
            return new PlanModel(source);
        }

        @Override
        public PlanModel[] newArray(int size) {
            return new PlanModel[size];
        }
    };
}
